package a.oschina.observedemo.demo1;

import java.util.ArrayList;
import java.util.List;

/**
 * &lt;功能详细描述&gt;
 *
 * @author Administrator
 * @version [版本号, 2018/10/23]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class Secretary {

    //同事列表
    private List<StockObserver> observers = new ArrayList<>();
    private String action;

    //增加
    public void attach(StockObserver stockObserver) {
        observers.add(stockObserver);
    }

    //通知
    public void notifyObserver() {
        for (StockObserver observer : observers) {
            observer.update();
        }
    }

    //前台状态
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

}
